# todo: algorithm implementation